<template>
  <div id="app">
    <!-- <NavBar/> -->
    <div id="nav">
      <!-- <router-link to="/">Home</router-link> | -->
      <!-- <router-link to="/about">About</router-link> -->
    </div>
    <router-view v-if="alive" />
  </div>
</template>

<script>
// @ is an alias to /src
// import NavBar from '@/components/NavBar.vue'

export default {
  name: "app",
  provide() {
    return {
      reload: this.reload
    };
  },
  components: {
    // NavBar
  },
  data() {
    return {
      alive: true
    };
  },
  created() {
    // var access_token = localStorage.getItem('access_token');
    // console.log(typeof(access_token));
    // if(access_token == null) {
    // //  this.$router.push("/");
    // // console.log('是否执行');
    // // this.$router.push({ path: '/home' })
    // }
  },
  methods: {
    reload() {
      this.alive = false;
      this.$nextTick(() => {
        this.alive = true;
      });
    }
  }
};
</script>

<style>
* {
  text-align: left;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
*::-webkit-scrollbar {
  display: none;
}
li {
  list-style: none;
}
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  width: 100%;
  height: 100%;
  text-align: center;
  overflow: hidden;
  background-color: #f5f5f5;
  /* margin-top: 64px; */
}
#nav {
  /* padding: 30px; */
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>
